package com.thunder.rebot.rebotclient.activity;

import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.TextPaint;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.limedia.explorer.centralcontrol.ControlActivity;
import com.thunder.rebot.rebotclient.R;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends BaseActivity {

    @BindView(R.id.title_txt)
    public TextView titltTxt;
    @BindView(R.id.register_txt)
    public Button registerTxt;
    @BindView(R.id.main_txt)
    public Button mainTxt;
    @BindView(R.id.setting_txt)
    public Button settingTxt;
    @BindView(R.id.return_txt)
    public Button returnTxt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
        AssetManager mgr=getAssets();//得到AssetManager
        Typeface tf= Typeface.createFromAsset(mgr, "fonts/big_title.ttf");//根据路径得到Typeface
        titltTxt.setTypeface(tf);//设置字体
        TextPaint tp = titltTxt.getPaint();
        tp.setFakeBoldText(true);
    }

    @OnClick({R.id.register_txt, R.id.main_txt, R.id.setting_txt,R.id.return_txt})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.register_txt:
                Intent intentRe=new Intent(this,RegisterActivity.class);
                startActivity(intentRe);
                break;
            case R.id.main_txt:
                Intent intentMain=new Intent(this,ControlActivity.class);
                startActivity(intentMain);
                break;
            case R.id.setting_txt:
                Intent intentSetting=new Intent(this,SettingActivity.class);
                startActivity(intentSetting);
                break;
            case R.id.return_txt:
                finish();
                break;
        }
    }
}
